<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!DOCTYPE html>
<html>
	<head>
		<base href="<%=basePath%>"/>
		<meta charset="utf-8" />
		<title>Document</title>
	</head>
	<style type="text/css">
		#hezi{
			width:800px;
			margin:auto;
		}
		#hezi table{
			border-collapse: collapse;
		}
	</style>
	<body>
			<div id="hezi">
				<h2>教材列表</h2>
				<hr />
				<form action="">
					教材名称<input type="text" name="name" />&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
					年级<select name="gradeid" id="">
						<option value="-1">全部</option>
						<c:forEach items="${gradelisst }" var="g">
							<option value="${g.id }">${g.gradeName }</option>
						</c:forEach>
					</select>
					<input type="submit" value="查询" />
					<a href="add.shtml"><input type="button"  value="增加"/></a>
					<table border="1" width="100%">
						<tr>
							<th>编号 </th>
							<th>教材名称</th>
							<th>所属年级</th>
							<th>操作</th>
						</tr>
						<c:forEach items="${booklist }" var="book">
							<tr>
								<td>${book.id }</td>
								<td>${book.bookName }</td>
								<td>${book.getGrade().getGradeName() }</td>
								<td><a href="del.shtml?id=${book.id }" onclick=" return confirm('确定要删除吗?')">删除</a></td>
							</tr>
						</c:forEach>
					</table>
				</form>
			</div>
	</body>
</html>
